package com.repair.order.facade;

import com.repair.api.comment.request.OrderCommRequest;
import com.repair.api.comment.response.CommentOrderResponse;
import com.repair.api.order.request.OrderAddGrabPoolRequest;
import com.repair.api.order.request.OrderAssignRequest;
import com.repair.api.order.request.OrderQueryPageRequest;
import com.repair.api.order.request.OrderQueryRequest;
import com.repair.api.order.request.param.OrderAssignParam;
import com.repair.api.order.request.param.OrderQueryParam;
import com.repair.api.order.response.OrderAddGrabPoolResponse;
import com.repair.api.order.response.OrderAssignResponse;
import com.repair.api.order.response.OrderQueryResponse;
import com.repair.api.order.response.vo.OrderVO;
import com.repair.api.order.service.OrderFacadeService;
import com.repair.base.response.PageResponse;
import com.repair.order.service.OrderService;
import com.repair.rpc.config.Facade;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author zcy
 * @since 2024/10/19,14:30
 *
 */
@DubboService
public class OrderFacadeServiceImpl implements OrderFacadeService {

    @Autowired
    private OrderService orderService;

    @Override
    @Facade
    public CommentOrderResponse<String> commentOrder(OrderCommRequest orderCommRequest) {
        return orderService.updateCommentId(orderCommRequest);
    }

    @Override
    @Facade
    public PageResponse<OrderVO> getAllOrders(OrderQueryPageRequest<OrderQueryParam> request) {
        return orderService.getAllOrders(request);
    }

    @Override
    @Facade
    public OrderQueryResponse<OrderVO> getOrderInfoByAdmin(OrderQueryRequest request) {
        return orderService.getOrderInfoByAdmin(request);
    }

    @Override
    @Facade
    public OrderAssignResponse<Boolean> assignOrderToWorker(OrderAssignRequest<OrderAssignParam> request) {
        return orderService.assignOrderToWorker(request);
    }

    @Override
    @Facade
    public OrderAddGrabPoolResponse<Boolean> addOrderToGrabPool(OrderAddGrabPoolRequest request) {
        return orderService.addOrderToGrabPool(request);
    }

}
